import request from "@/request/request";
import qs from "qs";
//精品推荐数据接口
// export const JinpingAPI = function () {
//   return request.get("/products/recommend");
// };

//精品推荐数据接口
export const JinpingAPI = () => request.get("/products/recommend");
//热门兑换接口
export const ReMenAPI = () => request.get("/products/hot");
//验证码登录、注册 接口
export const getValidationCode = (
  params //qs.stringify()序列化参数
) => request.post("/sendSMS", qs.stringify(params));
//登录接口
export const LoginReginAPI = (params) =>
  request.post("/phoneRegin", qs.stringify(params));
//微信绑定手机号接口
export const PhoneBindingAPI = (params) =>
  request.post("/wechatUsers/binding", qs.stringify(params));
//微信扫码登陆接口
export const WeChatLoginAPI = (params) =>
  request.post("/wechatUsers/PCLogin", qs.stringify(params));
//获取用户信息接口
export const UserProfilesAPI = (params) =>
  request.get("/shop/userProfiles", qs.stringify(params));
//获取详细商品详细信息接口
export const GoodDetailsAPI = (id) => request.get(`/products/${id}`);
//获取商品列表接口
export const getGoodsListAPI = (params) => request.get("/products", { params });
//获取购物车信息接口
export const getCartAPI = () => request.get("/shop/carts");
//添加到购物车接口
export const addToCartAPI = (params) =>
  request.post("/shop/carts/add", qs.stringify(params));
  //删除商品接口
  export const deleteTheGoodsAPI = (id) => request.delete(`/shop/carts?productIds=${id}`);